package com.xtoad.ecms.common.web.exception;

/**
 * 请求结果统一编码
 *
 * @author xtoad
 * @date 2020/05/29
 */
public enum ResultCodeEnum {

    /**
     * 成功
     */
    SUCCESS("000000","成功"),
    /**
     * 请求参数不正确
     */
    INVALID_PARAMETER("000400", "请求参数有误"),
    /**
     * 无效的token
     */
    EXPIRED_TOKEN("000401","无效的token"),
    /**
     * 查找的资源不存在
     */
    NOT_FOUND("000404","请求的资源不存在"),
    /**
     * 未知异常
     */
    UNKNOWN_ERROR("000500","请求发生异常");

    /**
     * 错误编码
     */
    private String code;
    /**
     * 错误消息
     */
    private String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    ResultCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
